package com.hh.bss.mobile.controller;

import java.io.IOException;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;

import com.hh.bss.auth.client.OnlineManager;
import com.hh.bss.auth.client.OnlineUser;
import com.hh.bss.base.BaseSpringController;
import com.hh.bss.common.page.Page;
import com.hh.bss.common.page.PageRequest;
import com.hh.bss.project.service.ContractJobCvOfferService;
import com.hh.bss.project.vo.query.ContractJobCvOfferQuery;
import com.hh.bss.project.vo.query.ContractJobCvRecomQuery;
import com.hh.bss.util.extjs.ExtJsPageHelper;
@Controller
public class OfferController extends BaseSpringController  {
	private ContractJobCvOfferService contractJobCvOfferService;
	public void setContractJobCvOfferServiceImpl(ContractJobCvOfferService service) {
		this.contractJobCvOfferService = service;
	}
	public ModelAndView offerPage(HttpServletRequest request, HttpServletResponse response,ContractJobCvOfferQuery contractJobCvOfferQuery) throws IOException {
		OnlineManager onlineManager=super.getOnlineManager(request, response);
		if (onlineManager!=null){
			OnlineUser onlineUser=onlineManager.getOnlineUser();
			contractJobCvOfferQuery.setOnlineUser(onlineUser);
		}
		
		Page page = contractJobCvOfferService.findCvOfferPage(contractJobCvOfferQuery);
		//query.getPageSize(), query.getPageNumber()
		ModelAndView mv = new ModelAndView();
		mv.setViewName("/mobile/offerManagerPage");
		
		mv.addObject("pages", page);
		mv.addObject("query", contractJobCvOfferQuery);
		response.setCharacterEncoding("UTF-8");
		return mv;
		
	}
}
